using CfgTable;
using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;

namespace IQIGame.Onigao.GamePlay
{
    /// <summary>
    /// 弹窗UI数据，注意该数据可能会多个公共UI共用，但使用逻辑还是遵循规范
    /// </summary>
    public class UD_Confirm : UIBaseData
    {
        public CfgNotice cfgNotice;

        public string finalDesc;

        public System.Action callBtnConfirm;
        public System.Action callBtnCancel;
        public System.Action callBtnClose;

        public static UD_Confirm Create(CfgNotice cfgNotice, string finelDesc, System.Action callConfirm, System.Action callCancel, System.Action callClose)
        {
            var d = ClassPool<UD_Confirm>.Get();
            d.cfgNotice = cfgNotice;
            d.finalDesc = finelDesc;
            d.callBtnConfirm = callConfirm;
            d.callBtnCancel = callCancel;
            d.callBtnClose = callClose;
            return d;
        }

        #region 对象池
        public override uint MaxStore => 10;

        public override void OnReset()
        {
            this.cfgNotice = null;
            this.callBtnConfirm = null;
            this.callBtnCancel = null;
            this.callBtnClose = null;
        }
        #endregion

    }
}
